/**
 * @(#)BaseResultVo.java 2016年11月4日
 * Copyright(C) 2016 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.domian.channel;

import org.jsbd.boss.enums.ResponseEnum;

import com.alibaba.fastjson.JSONObject;

/**
 * 返回给客户端结果
 * 
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
public class BaseResultVo {

	// 1成功 2业务异常 3服务异常
	private int status = ResponseEnum.SUCC.getStatus();
	private String message;
	private Object data;

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public boolean isSuccess() {
		if (status == ResponseEnum.SUCC.getStatus()) {
			return true;
		} else {
			return false;
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return JSONObject.toJSONString(this);
	}

}
